<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>parametres</title>

<?php $this->load->helper('url');?>
<!---------------------for autocomplete--------------->
	<script type="text/javascript" src="<?php echo base_url('assets/js/jquery-1.11.0.min.js');?>" ></script>
	<script type="text/javascript" src="<?php echo base_url('assets/js/jquery-ui-1.10.4/js/jquery-ui-1.10.4.min.js');?>" ></script>
	<link href="<?php echo base_url("assets/css/jquery-ui.css")?>" rel="stylesheet" type="text/css" />
<!---------------------for form css ----------------------->
	<link href="<?php echo base_url("assets/css/pure.css")?>" rel="stylesheet" type="text/css" />
	 <link href="<?php echo base_url("assets/css/botton.css")?>" rel="stylesheet" type="text/css" />
<!---------------------for form validation ----------------------->
<script type="text/javascript" src="<?php echo base_url('assets/js/jquery.validate.js');?>" ></script>
<!---------------------for form mask input ----------------------->
<script type="text/javascript" src="<?php echo base_url('assets/js/jquery.mask.min.js');?>" ></script>


</head>
<body>



<form id="para_frm" class="pure-form pure-form-stacked" method="POST" action="<?php echo base_url('login_ctr/valider_parametre');?>">
    <fieldset>
        <legend style="font-size: 150%">تفاصيل : </legend>

        <div class="pure-g">
            <div class="pure-u-1 pure-u-md-1-3" style="width: 30%">
                <label for="fournisseur">الحد الاعلى للاتفاقية: </label>
				<input id="tva" name="seuil_convention" type="text" value="7000000">
            </div>
            
			<div class="pure-u-1 pure-u-md-1-3 " style="width: 30%">
                <label for="numero"> الحد الاعلى لوصل الطلب : </label>
				<input id="seuill" name="seuill" type="text" value="500000">
                
            </div>
			
			 

           
	
   </div>
	
<?php
 

		
		
echo (' <input type="submit" id="submit_btn" value="تسجيل"  class="pure-button pure-button-primary" />
      	

	');
	  
?>
</fieldset>			
			
</form>
	

     
		
     
			

		
</body>

<script>

$('#submit_btn').click(function() {
  if($("[class^=error]").is(":visible")){
    alert('منالك حقل / حقول إدخال غير مطابقة !');
    return false;
  } else {
  	$('#para_frm').submit();
    return false;
  }
});
//---
$('#tva').bind('mouseup keyup focusout focus mousemove',function() {
    $('span.error-rib').hide();
	$(this).css('background-color','pink');
    var inputVal = $(this).val();
   // var characterReg = /^(\d{3}-\d{5}-\d{10}-\d{2})$/;
	 var characterReg = /^([0-9]+)$/;
    if(!characterReg.test(inputVal)) {
        $(this).after('<span class="error-rib" style="color:red;" >حقل غير مطابق للشكل العام </span>');
    }else{
		$(this).css('background-color','#FFFFFF');
	}
});

$('#seuill').bind('mouseup keyup focusout focus mousemove',function() {
    $('span.error-rib').hide();
	$(this).css('background-color','pink');
    var inputVal = $(this).val();
   // var characterReg = /^(\d{3}-\d{5}-\d{10}-\d{2})$/;
	 var characterReg = /^([0-9]+(,[0-9]+)*)$/;
    if(!characterReg.test(inputVal)) {
        $(this).after('<span class="error-rib" style="color:red;" >حقل غير مطابق للشكل العام </span>');
    }else{
		$(this).css('background-color','#FFFFFF');
	}
});


</script>

</html>